'use strict';
var Model = require('../../../Base/server/controllers/Model');

var modelField = {};
modelField.Barcode = {
    type: String,
    Name: '条码',
    IsEmpty: false,
    trim: true
};
modelField.ItemMasterCode = {
    type: String,
    Name: '料号',
    IsEmpty: false,
    trim: true
};
modelField.ItemMasterName = {
    type: String,
    Name: '料品名称',
    IsEmpty: false,
    trim: true
};
//质检状态
modelField.QCStatus = {
    type: Number
};
//部门名称
modelField.DepartmentName = {
    type: String,
    trim: true
};
//工位名称
modelField.WorkLocationName = {
    type: String,
    trim: true
};
//作业名称
modelField.WorkName = {
    type: String,
    trim: true
};
//异常类型，枚举
modelField.ExceptionType = {
    type: Number
};

//漏刷作业名称
modelField.MissingWorkName = {
    type: String,
    trim: true
};
//漏刷作业时间
modelField.MissingWorkDateTime = {
    type: Date,
    default: Date.now
};
//异常信息
modelField.Message = {
    type: String,
    trim: true
};
//已读
modelField.IsRead = {
    type: Boolean
};

//扩展字段:
modelField.DescSeg1 = {
    type: String,
    default: '',
    trim: true
};
modelField.DescSeg2 = {
    type: String,
    default: '',
    trim: true
};

var newModel = new Model(modelField);
newModel.addIndex({Barcode: 1});
newModel.create('ProcessException', '流水异常');
